//
// Created by PC on 2023/10/16.
// 素数 埃式筛法
//


#include <iostream>

using namespace std;

int main()
{
    int a=100; //out: 25
    a = 1740948; // out: 130971
//    a = 2115790; //out:156902
//    a=91571465;// out: 5302853
//    a = 65090061389;//out: 2728793966
//    cin>>a;
    bool isPrime[a+1]={0};
    for (int i = 2; i < a+1; ++i)
        isPrime[i]=1;
    for (int i = 0; i < a+1; ++i)
    {
        if (isPrime[i])
        {
            for (int j = 2*i; j < a+1 ; j+=i)
            {
                isPrime[j]=0;
            }
        }
    }
    int count=0;
    for (int i = 2; i < a + 1; ++i)
    {
        count=isPrime[i]?count+1:count;
    }
    cout<<count;

    return 0;
}